# psip
# Builds from https://github.com/puppylinux-woof-CE/petbuilds
# File auto generated by ./mk_petbuild.sh. Edit as necessary.

. ../func
. ../build.conf

URL=http://distro.ibiblio.org/puppylinux/sources/p
SPKG=PSIP
SVER=0c3150ce6d
PKG=psip
VER=1.41
COMP=tar.gz
DESC="Psip is a sip phone application especially developed for Puppy Linux"
DEPS=+osxcart
CAT=internet
DESKTOP=psip.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
# comment these 2 below if you use a custom package() function
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not

ARCH=$(uname -m)
case $ARCH in # set in build.conf
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

build() {
	mv ${SPKG}-${SVER} ${PKG}-${VER}
	cd ${PKG}-${VER}
	make release
	cd -
}

package() {
	install -d -m 0755 ${PKG}-${VER}-${ARCH}_${BUILD}/usr/bin
	install -d -m 0755 ${PKG}-${VER}-${ARCH}_${BUILD}/usr/share/pixmaps
	install -d -m 0755 ${PKG}-${VER}-${ARCH}_${BUILD}/usr/share/applications
	install -s -m 0755 ${PKG}-${VER}/psip ${PKG}-${VER}-${ARCH}_${BUILD}/usr/bin
	install -s -m 0755 ${PKG}-${VER}/psip-no-recorder ${PKG}-${VER}-${ARCH}_${BUILD}/usr/bin
	install -m 0644 ${PKG}-${VER}/psip48.png ${PKG}-${VER}-${ARCH}_${BUILD}/usr/share/pixmaps/
	install -m 0644 $DESKTOP ${PKG}-${VER}-${ARCH}_${BUILD}/usr/share/applications/
	install -d -m 0755 ${PKG}_DEV-${VER}-${ARCH}_${BUILD}/usr/src/dev
	cat ${PKG}.petbuild > ./${PKG}_DEV-${VER}-${ARCH}_${BUILD}/usr/src/dev/${PKG}-build-recipe
	for p in $(ls|grep "\-${ARCH}"|grep -v "files$") ; do
		case $p in
			*_DEV*) DESC="$PKG development"; DEPS=+${PKG} ;;
			*_DOC*) DESC="$PKG documentation"; DEPS=+${PKG} ;;
			*_NLS*) DESC="$PKG locales"; DEPS=+${PKG} ;;
		esac	
		echo "packaging $p"	
		dir2pet -x -s -w="$DESC" -d="$DEPS" -c="$CAT" -p=${p} 2>&1 >/dev/null
		rm -r $p
		mv ${p}.pet ../0pets_out/
	done
	#rm -r ${PKG}-install
	rm -r ${PKG}-${VER}
	#mv -f *.files ../0logs/
	echo "done!"
}
	
# main
retrieve ${SPKG}-${SVER}.${COMP}
extract ${SPKG}-${SVER}.${COMP}
build
package
